export default {
    namespaced: true,
    state: () => ({
        addressList: [
            
        ],
        addressedit: {}
    }),
    mutations: {
        AddressAddMut(state, obj) { //修改地址或新增
            if (obj.edit != -1) {//修改
                console.log(1);
                state.addressList[obj.edit] = obj.obj
                return
            }
            if(obj.obj.name==""||obj.obj.address==""&&obj.obj.tel == ""&&obj.obj.district&&obj.obj.addre==""){
                return
            }
            state.addressList.push(obj.obj)//新增
        },
        delMut(state,idx){
            state.addressList.splice(idx,1)
        }

    }

}